import {AsyncStorage} from 'react-native'


export let appBooted = ()=>{
  return {
    type:'APP_BOOTED'
  }
}
//启动轮播组件
export let enteredSlide = ()=>{
  return (dispatch,getState)=>{
    AsyncStorage
      .setItem('entered','yes')
      .then(()=>{dispatch})
  }
}
//
export let willEnterApp = ()=>{
  return (dispatch,getState)=>{
    AsyncStorage
      .multiGet(['user','entered'])
      .then((data)=>{
        let user = data[0]
        let entered = data[1]
        dispatch({
          type:'WILL_ENTER_APP',
          payload:{
            user:user,
            entered:entered
          }
        })
      })
  }
}